﻿// DlgMTCheck.cpp : 实现文件
//

#include "stdafx.h"
#include "POSCheck.h"
#include "DlgMTCheck.h"



// CDlgMTCheck 对话框

IMPLEMENT_DYNAMIC(CDlgMTCheck, CDialog)

CDlgMTCheck::CDlgMTCheck(CWnd* pParent /*=NULL*/)
	: CDialog(CDlgMTCheck::IDD, pParent)
{
    m_bPT = FALSE;
    m_nStatus = ES_Unchecked;
}

CDlgMTCheck::~CDlgMTCheck()
{
}

void CDlgMTCheck::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
}

BOOL CDlgMTCheck::OnInitDialog()
{
    CDialog::OnInitDialog();

    GetDlgItem(IDC_RADIO_MONITOR_NORMAL)->EnableWindow(m_bPT);
    GetDlgItem(IDC_RADIO_MONITOR_ERROR)->EnableWindow(m_bPT);
    GetDlgItem(IDC_RADIO_MONITOR_PASS)->EnableWindow(m_bPT);

    return TRUE;
}

BEGIN_MESSAGE_MAP(CDlgMTCheck, CDialog)
    ON_BN_CLICKED(IDC_RADIO_MONITOR_NORMAL, &CDlgMTCheck::OnBnClickedRadioMonitorNormal)
    ON_BN_CLICKED(IDC_RADIO_MONITOR_ERROR, &CDlgMTCheck::OnBnClickedRadioMonitorError)
    ON_BN_CLICKED(IDC_RADIO_MONITOR_PASS, &CDlgMTCheck::OnBnClickedRadioMonitorPass)
    ON_BN_CLICKED(IDOK, &CDlgMTCheck::OnBnClickedOk)
END_MESSAGE_MAP()


// CDlgMTCheck 消息处理程序


void CDlgMTCheck::OnBnClickedRadioMonitorNormal()
{
    m_nStatus = ES_Normal;
    GetDlgItem(IDOK)->EnableWindow();
}


void CDlgMTCheck::OnBnClickedRadioMonitorError()
{
    m_nStatus = ES_Exception;
    GetDlgItem(IDOK)->EnableWindow();
}


void CDlgMTCheck::OnBnClickedRadioMonitorPass()
{
    m_nStatus = ES_Exception;
    GetDlgItem(IDOK)->EnableWindow();  
}


void CDlgMTCheck::OnBnClickedOk()
{
    if (m_bPT)
    {
        GetParent()->PostMessage(WM_PT_MONITOR, m_nStatus);
    }
    
    CDialog::OnOK();
}
